//
//  AITopicTopCollectionCell.m
//  Mia
//
//  Created by Vill on 2024/2/21.
//

#import "AITopicTopCollectionCell.h"

@interface AITopicTopCollectionCell ()

@property (nonatomic, strong) UIButton *tagBtn;

@end

@implementation AITopicTopCollectionCell

- (instancetype)initWithFrame:(CGRect)frame{
    if(self == [super initWithFrame:frame]){
        [self setUI];
    }
    return self;
}

-(void)setUI{
    [self.contentView addSubview:self.tagBtn];
    [self.tagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.contentView);
    }];
}

- (UIButton *)tagBtn{
    if(!_tagBtn){
        _tagBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_tagBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
        _tagBtn.titleLabel.font = [UIFont fontWithWeight:Medium size:PTW(12)];
        _tagBtn.backgroundColor = [UIColor colorHex:@"#333333" alpha:0.3];
        _tagBtn.userInteractionEnabled = NO;
        _tagBtn.layer.cornerRadius = PTW(15);
        _tagBtn.layer.masksToBounds = YES;
    }
    return _tagBtn;
}

- (void)setBtnStr:(NSString *)btnStr{
    _btnStr = btnStr;
    [self.tagBtn setTitle:btnStr forState:UIControlStateNormal];
}


@end
